set(sqlite_sources)
set(sqlite_headers)
set(private_sqlite_header)
set(sqlite_libraries)
if(${ENABLE_SQLITE})
  set(sqlite_sources
      model/sqlite-data-output.cc
      model/sqlite-output.cc
  )
  set(sqlite_headers
      model/sqlite-data-output.h
  )
  set(private_sqlite_headers
      model/sqlite-output.h
  )
  set(sqlite_libraries
      ${SQLite3_LIBRARIES}
  )
endif()

set(source_files
    ${sqlite_sources}
    helper/file-helper.cc
    helper/gnuplot-helper.cc
    model/boolean-probe.cc
    model/basic-data-calculators.cc
    model/data-calculator.cc
    model/data-collection-object.cc
    model/data-collector.cc
    model/data-output-interface.cc
    model/double-probe.cc
    model/file-aggregator.cc
    model/get-wildcard-matches.cc
    model/gnuplot-aggregator.cc
    model/gnuplot.cc
    model/histogram.cc
    model/omnet-data-output.cc
    model/probe.cc
    model/time-data-calculators.cc
    model/time-probe.cc
    model/time-series-adaptor.cc
    model/uinteger-16-probe.cc
    model/uinteger-32-probe.cc
    model/uinteger-8-probe.cc
)

set(header_files
    ${sqlite_headers}
    helper/file-helper.h
    helper/gnuplot-helper.h
    model/average.h
    model/basic-data-calculators.h
    model/boolean-probe.h
    model/data-calculator.h
    model/data-collection-object.h
    model/data-collector.h
    model/data-output-interface.h
    model/double-probe.h
    model/file-aggregator.h
    model/get-wildcard-matches.h
    model/gnuplot-aggregator.h
    model/gnuplot.h
    model/histogram.h
    model/omnet-data-output.h
    model/probe.h
    model/stats.h
    model/time-data-calculators.h
    model/time-probe.h
    model/time-series-adaptor.h
    model/uinteger-16-probe.h
    model/uinteger-32-probe.h
    model/uinteger-8-probe.h
)

build_lib(
  LIBNAME stats
  SOURCE_FILES ${source_files}
  HEADER_FILES ${header_files}
  PRIVATE_HEADER_FILES ${private_sqlite_headers}
  LIBRARIES_TO_LINK ${libcore}
                    ${sqlite_libraries}
  TEST_SOURCES
    test/average-test-suite.cc
    test/basic-data-calculators-test-suite.cc
    test/double-probe-test-suite.cc
    test/histogram-test-suite.cc
)
